/* 
 * Created on 2007-2-7
 * Last modified on 2007-2-7
 * Powered by YeQiangWei.com
 */
package com.yeqiangwei.util;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;


public class HttpServletUtils {
	
	private static final Logger logger = Logger.getLogger(HttpServletUtils.class);
	
	public static void forward(HttpServletRequest request
			,HttpServletResponse response
			, String url)
	{
		try {
			request.getRequestDispatcher(url).forward(request,response);
			return ;
		} catch (ServletException e) {
			logger.error(e.toString());
		} catch (IOException e) {
			logger.error(e.toString());
		}
	}
	
	public static void redirect(HttpServletResponse response,String url){
		try {
			response.sendRedirect(url);
			return ;
		} catch (IOException e) {
			logger.error(e.toString());
		}
	}
}
